package com.example.kotlinExample.entity

import org.hibernate.validator.constraints.Length
import org.springframework.web.multipart.MultipartFile
import javax.validation.constraints.NotBlank
import javax.validation.constraints.NotNull
import javax.validation.constraints.Pattern

/**
 *
 *
 * @author liliang
 */
data class PersonParam(
        @field:NotNull(message = "id不能为空")
        var id: Int?,
        @field:NotBlank(message = "名字不能为空")
        @field:Pattern(regexp = "[\\u4E00-\\u9FA5]+", message = "名字只能是不带空格的中文")
        @field:Length(min = 2, max = 7, message = "名字字数必须2-7之间")
        var name: String?,
        @field:NotNull(message = "头像不能为空")
        var avatar: MultipartFile?,
        @field:NotNull(message = "照片不能为空")
        var photo: MultipartFile?)